package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.time.LocalDate;
import java.util.List;

/**
 * 采购订单实体类
 */
@TableName("t_buyorder")
@ApiModel(value = "采购订单实体类", description = "封装采购订单相关属性")
public class BuyOrderBean {
    /**
     * 采购订单id
     */
    @TableId(value = "pk_buyOrderId", type = IdType.AUTO)
    @ApiModelProperty("采购订单id")
    private Integer buyOrderId;
    /**
     * 供应商名称
     */
    @TableField("b_supplierName")
    @ApiModelProperty("供应商名称")
    private String supplierName;
    /**
     * 采购日期
     */
    @TableField("b_buyDate")
    @ApiModelProperty("采购日期")
    private LocalDate buyDate = LocalDate.now();
    /**
     * 采购员id
     */
    @TableField("fk_userId")
    @ApiModelProperty("采购员id")
    private Integer userId;
    @TableField(exist = false)
    @ApiModelProperty("采购员对象")
    private UserBean user;
    @TableField(exist = false)
    @ApiModelProperty("采购员真实姓名")
    private String relName;
    @TableField(exist = false)
    @ApiModelProperty("采购明细集合")
    private List<BuyDetailBean> buyDetailList;

    public BuyOrderBean() {
    }

    public BuyOrderBean(String supplierName, Integer userId) {
        this.supplierName = supplierName;
        this.userId = userId;
    }

    public Integer getBuyOrderId() {
        return buyOrderId;
    }

    public void setBuyOrderId(Integer buyOrderId) {
        this.buyOrderId = buyOrderId;
    }

    public String getSupplierName() {
        return supplierName;
    }

    public void setSupplierName(String supplierName) {
        this.supplierName = supplierName;
    }

    public LocalDate getBuyDate() {
        return buyDate;
    }

    public void setBuyDate(LocalDate buyDate) {
        this.buyDate = buyDate;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public UserBean getUser() {
        return user;
    }

    public void setUser(UserBean user) {
        this.user = user;
    }

    public List<BuyDetailBean> getBuyDetailList() {
        return buyDetailList;
    }

    public void setBuyDetailList(List<BuyDetailBean> buyDetailList) {
        this.buyDetailList = buyDetailList;
    }

    public String getRelName() {
        return relName;
    }

    public void setRelName(String relName) {
        this.relName = relName;
    }

    @Override
    public String toString() {
        return "BuyOrderBean{" +
                "buyOrderId=" + buyOrderId +
                ", supplierName='" + supplierName + '\'' +
                ", buyDate=" + buyDate +
                ", userId=" + userId +
                ", user=" + user +
                ", relName='" + relName + '\'' +
                ", buyDetailList=" + buyDetailList +
                '}' + "\n";
    }
}
